﻿Module Locales
    Dim setting As New My.MySettings
    Public Sub local()
        'Перевод
        Select Case (Form1.RadioButton2.Checked)
            Case True
                Form1.ПомощьToolStripMenuItem.Text = "Help"
                Form1.НастройкиToolStripMenuItem.Text = "Settings"
                Form1.СправкаToolStripMenuItem.Text = "Help"
                Form1.ОПрограммеToolStripMenuItem.Text = "About the Program"
                Form1.ВыйтиToolStripMenuItem.Text = "Exit"
                Form1.GroupBox1.Text = "Settings"
                Form1.GroupBox2.Text = "Language"
                Form1.Button11.Text = "Clear Fields"
                Form1.Button1.Text = "Generate sql query"
                Form1.Button2.Text = "Generate sql query"
                Form1.Button3.Text = "Generate sql query"
                Form1.Button4.Text = "Generate sql query"
                Form1.Button5.Text = "Generate sql query"
                Form1.Button18.Text = "Generate sql query"
                Form1.Button8.Text = "Generate sql query"
                Form1.Button6.Text = "Generate sql query"
                Form1.Button7.Text = "Generate sql query"
                Form1.Button21.Text = "OK"
                Form1.Button20.Text = "Apply"
                Form1.Button19.Text = "Cancel"
                Form1.ДругиеПрограммыToolStripMenuItem.Text = "Other Programs"
                Form1.GroupBox4.Text = "Options connect to database"
                Form1.Label45.Text = "Hostname:"
                Form1.Label46.Text = "Username:"
                Form1.Label47.Text = "Password:"
                Form1.Label48.Text = "Port:"
                Form1.CheckBox1.Text = "Save password"
                Form1.Button22.Text = "Open URL"
                sp.Text = "Help"
                sp.Label1.Text = "Welcome to the help section. Here you will be able to learn more about the purpose of all functions of the program."
                sp.Button1.Text = "Close"
                Form1.Button23.Text = "Run sql query"
                Form1.CheckBox2.Text = "Show confirmation query"
                Form1.Button9.Text = "Quick save"
                Form1.Button10.Text = "Save multiple query"
                SaveForm.Text = "Save multiple query"
                br.ToolStripStatusLabel2.Text = "Site Program"
                Form1.Button15.Text = "Open URL creature"
                Form1.Button17.Text = "Open URL quest"
                Form1.Button16.Text = "Open URL object"
        End Select
        Select (Form1.RadioButton1.Checked)
            Case True
                Form1.ПомощьToolStripMenuItem.Text = "Помощь"
                Form1.НастройкиToolStripMenuItem.Text = "Настройки"
                Form1.СправкаToolStripMenuItem.Text = "Справка"
                Form1.ОПрограммеToolStripMenuItem.Text = "О программе"
                Form1.ВыйтиToolStripMenuItem.Text = "Выйти"
                Form1.GroupBox1.Text = "Настройки"
                Form1.GroupBox2.Text = "Язык"
                Form1.Button11.Text = "Очистить поля"
                Form1.Button1.Text = "Сгенерировать sql запрос"
                Form1.Button2.Text = "Сгенерировать sql запрос"
                Form1.Button3.Text = "Сгенерировать sql запрос"
                Form1.Button4.Text = "Сгенерировать sql запрос"
                Form1.Button5.Text = "Сгенерировать sql запрос"
                Form1.Button18.Text = "Сгенерировать sql запрос"
                Form1.Button8.Text = "Сгенерировать sql запрос"
                Form1.Button6.Text = "Сгенерировать sql запрос"
                Form1.Button7.Text = "Сгенерировать sql запрос"
                Form1.Button21.Text = "OK"
                Form1.Button20.Text = "Применить"
                Form1.Button19.Text = "Отмена"
                Form1.ДругиеПрограммыToolStripMenuItem.Text = "Другие программы"
                Form1.GroupBox4.Text = "Параметры подключения к базе"
                Form1.Label45.Text = "Имя хоста:"
                Form1.Label46.Text = "Пользователь:"
                Form1.Label47.Text = "Пароль:"
                Form1.Label48.Text = "Порт:"
                Form1.CheckBox1.Text = "Сохранить пароль"
                Form1.Button22.Text = "Открыть URL предмета"
                sp.Text = "Справка"
                sp.Label1.Text = "Добро пожаловать в раздел справки. Тут вы сможите подробнее узнать о предназначении всех функций программы."
                sp.Button1.Text = "Закрыть"
                Form1.Button23.Text = "Выполнить sql запрос"
                Form1.CheckBox2.Text = "Показывать подтверждение выполнения запроса"
                Form1.Button9.Text = "Быстрое сохранение"
                Form1.Button10.Text = "Сохранение нескольких запросов"
                SaveForm.Text = "Сохранение нескольких запросов"
                br.ToolStripStatusLabel2.Text = "Страница программы"
                Form1.Button15.Text = "Открыть URL существа"
                Form1.Button17.Text = "Открыть URL квеста"
                Form1.Button16.Text = "Открыть URL обекта"
        End Select
    End Sub
    Public Sub setti()
        'Сохранение настроек
        setting.SaveCOR1 = Form1.RadioButton1.Checked
        setting.SaveCOR2 = Form1.RadioButton2.Checked
        setting.SaveCOR3 = Form1.CheckBox2.Checked
        setting.SaveCOR4 = Form1.CheckBox1.Checked
        setting.SaveCOR5 = Form1.TextBox46.Text
        setting.SaveCOR6 = Form1.TextBox47.Text
        setting.SaveCOR7 = Form1.TextBox50.Text
        If Form1.CheckBox1.Checked = True Then
            setting.SaveCOR8 = Form1.TextBox48.Text
        End If
        setting.Save()
    End Sub
    Public Sub clean()
        'Чистка полей
        Form1.TextBox1.Text = ""
        Form1.TextBox2.Text = ""
        Form1.TextBox3.Text = ""
        Form1.TextBox4.Text = ""
        Form1.TextBox20.Text = ""
        Form1.TextBox21.Text = ""
        Form1.TextBox19.Text = ""
        Form1.TextBox18.Text = ""
        Form1.TextBox4.Text = ""
        Form1.TextBox9.Text = ""
        Form1.TextBox10.Text = ""
        Form1.TextBox8.Text = ""
        Form1.TextBox11.Text = ""
        Form1.TextBox12.Text = ""
        Form1.TextBox13.Text = ""
        Form1.TextBox14.Text = ""
        Form1.TextBox4.Text = ""
        Form1.TextBox7.Text = ""
        Form1.TextBox6.Text = ""
        Form1.TextBox5.Text = ""
        Form1.TextBox4.Text = ""
        Form1.TextBox17.Text = ""
        Form1.TextBox16.Text = ""
        Form1.TextBox15.Text = ""
        Form1.TextBox4.Text = ""
        Form1.TextBox28.Text = ""
        Form1.TextBox27.Text = ""
        Form1.TextBox4.Text = ""
        Form1.TextBox24.Text = ""
        Form1.TextBox23.Text = ""
        Form1.TextBox4.Text = ""
        Form1.TextBox22.Text = ""
        Form1.TextBox25.Text = ""
        Form1.TextBox26.Text = ""
        Form1.TextBox4.Text = ""
        Form1.TextBox29.Text = ""
        Form1.TextBox30.Text = ""
        Form1.TextBox31.Text = ""
        Form1.TextBox33.Text = ""
        Form1.TextBox32.Text = ""
        Form1.TextBox35.Text = ""
        Form1.TextBox34.Text = ""
        Form1.TextBox37.Text = ""
        Form1.TextBox36.Text = ""
        Form1.TextBox39.Text = ""
        Form1.TextBox38.Text = ""
        Form1.TextBox41.Text = ""
        Form1.TextBox40.Text = ""
        Form1.TextBox43.Text = ""
        Form1.TextBox42.Text = ""
        Form1.TextBox45.Text = ""
        Form1.TextBox44.Text = ""
        Form1.TextBox4.Text = ""
    End Sub
    Public Sub TimerError()
        If Form1.Timer1.Enabled = True And Form1.Timer2.Enabled = True Then
            Form1.Timer1.Enabled = False
            Form1.Timer2.Enabled = False
            Form1.Height = 458
        End If
    End Sub
    Public Sub randomize_status()
        ' Установить заголовок формы.
        Dim ApplicationTitle As String
        If My.Application.Info.Title <> "" Then
            ApplicationTitle = My.Application.Info.Title
        Else
            ApplicationTitle = System.IO.Path.GetFileNameWithoutExtension(My.Application.Info.AssemblyName)
        End If
        ' Рандом строка
        Randomize()
        Dim value As Integer = CInt(Int((10 * Rnd()) + 1))
        Dim information As String
        information = 0
        Select Case (value)
            Case 1
                information = "никогда не подведёт"
            Case 2
                information = "вы можете всегда на него положится"
            Case 3
                information = "делает за вас рутинную работу"
            Case 4
                information = "и целого мира мало!"
            Case 5
                information = "сделан специально для вас"
            Case 6
                information = "дружит с MySQL"
            Case 7
                information = "тут даже можно грабить корованы"
            Case 8
                information = "хочет с вами подружится"
            Case 9
                information = "правильный выбор!"
            Case 10
                information = "специально для ленивых"
        End Select
        AboutBox1.Text = String.Format(ApplicationTitle & " " & information)
    End Sub
End Module
